package com.ruibang.glass.quality.controller.manage;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruibang.glass.quality.domain.req.BatchDetailReq;
import com.ruibang.glass.quality.domain.req.HistoryBatchReq;
import com.ruibang.glass.quality.domain.resp.BatchDetailResp;
import com.ruibang.glass.quality.domain.resp.HistoryBatchResp;
import com.ruibang.glass.quality.service.HistoryBatchService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-04-29  14:24
 * @Description: TODO
 * @Version: 1.0
 */

@RestController
@RequestMapping("/api/quality/manage/historyBatch")
@Api(value = "历史批次控制器", tags = {"历史批次控制器"})
public class HistoryBatchController {

    @Autowired
    private HistoryBatchService historyBatchService;

    @PostMapping("/pageQuery")
    @ApiOperation(value = "历史批次信息", notes = "历史批次信息")
    public ResultBody<IPage<HistoryBatchResp>> pageQuery(@RequestBody HistoryBatchReq historyBatchReq) {
        return ResultBody.success(historyBatchService.pageQuery(historyBatchReq));
    }

    @PostMapping("/getBatchDetail")
    @ApiOperation(value = "获取批次详情", notes = "获取批次详情")
    public ResultBody<IPage<BatchDetailResp>> getBatchDetail(@RequestBody BatchDetailReq batchDetailReq) {
        return ResultBody.success(historyBatchService.getBatchDetail(batchDetailReq));
    }
}
